/**
 * Copyright 2010 The Regents of the University of California
 *
 *  All Rights Reserved
 */

/**
 *
 * File: arp-cache.h
 * For keeping the Host's IP mapping to it's actual MAC address, Pseudo MAC address (PMAC) and Pseudo IP (PIP) address
 */

#ifndef __ARP_CACHE_H__
#define __ARP_CACHE_H__

// include files
#include <inttypes.h>
#include "dcswitch.h"
#include "uthash.h"

// public types

typedef struct arp_cache_record
{
    uint32_t nw_addr;
    uint8_t dl_addr[ETH_ADDR_LEN];
    uint8_t pmac[ETH_ADDR_LEN];
	uint32_t pip;
    UT_hash_handle hh;
} arp_cache_record;


// public functions

arp_cache_record *arp_cache_entry(arp_cache_record ** arp_cache_table, uint32_t nw_addr);
int register_in_arp_cache(arp_cache_record ** arp_cache_table, uint32_t nw_addr, uint8_t *dl_addr, uint8_t *pmac, uint32_t pip );
#endif
